package com.ruoyi.flow.service.ruoyi.impl;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.flow.mapper.ruoyi.ProdFlowSysRoleMapper;
import com.ruoyi.flow.mapper.ruoyi.ProdFlowSysUserMapper;
import com.ruoyi.flow.service.ruoyi.ProdFlowSysUserService;
import com.ruoyi.flow.vo.org.FlowSysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @title:
 * @author: bruce.liu
 * @since: 2024/8/19 22:04
 */
@Service
public class ProdFlowSysUserServiceImpl implements ProdFlowSysUserService {

    @Autowired
    private ProdFlowSysUserMapper prodFlowSysUserMapper;
    @Autowired
    private ProdFlowSysRoleMapper prodFlowSysRoleMapper;

    @Override
    public SysUser selectUserById(Long userId) {
        return prodFlowSysUserMapper.selectUserById(userId);
    }

    /**
     * 通过用户名查询用户
     *
     * @param userName 用户名称
     * @return 用户对象信息
     */
    @Override
    public SysUser selectUserByUserName(String userName){
        return prodFlowSysUserMapper.selectUserByUserName(userName);
    }

    /**
     * 通过多个用户名查询用户
     *
     * @param userNameList 用户名称集合
     * @return 用户对象集合
     */
    @Override
    public List<FlowSysUser> selectUserListByUserNameList(List<String> userNameList){
        return prodFlowSysUserMapper.selectUserListByUserNameList(userNameList);

    }

    @Override
    public List<SysUser> selectSysUsersByRoleId(Long roleId) {
        return prodFlowSysUserMapper.selectSysUsersByRoleId(roleId);
    }

}
